#include <stdio.h>

int reverse( int number );
    
int main()
{
    int n;

    scanf("%d", &n);
    printf("%d\n", reverse(n));

    return 0;
}

int reverse( int number )
{
	int digit, result = 0;
	while(number != 0)
	{
		digit = number % 10;
		result  = result * 10 + digit;
		number /= 10;
	}
	
	return result;
}
